Automatic Programming method and device

ABSTRACT

Workpiece data involving a product shape and having a smallest diameter for lathe turning around a turning axis is selected from the workpiece database, by comparing dimension data of a workpiece model with dimension data of a product model in a state in which the product model is arranged on the turning axis and the workpiece model is arranged so that a center axis of each workpiece matches a center of the turning axis. The workpiece model for lathe turning is created based on the selected workpiece data.

TECHNICAL FIELD

The present invention relates to a technology for creating a numericalcontrol (NC) program using computer-aided-design (CAD) data, such as aproduct shape and a workpiece shape, with an automatic selection of anoptimum workpiece corresponding to a product.

BACKGROUND ART

In a machine tool on which an NC unit (numerical control unit) ismounted, a workpiece is machined into a desired product shape byexecuting the NC program. To create the NC creation program for creatingthe NC machining program, recently, an automatic programming techniqueusing a microcomputer referred to as an automatic programming apparatushas been frequently used.

The primitive automatic programming apparatuses were not connected tothe CAD data, and hence, it was necessary to perform programming, whilewatching the machining shape in a drawing or the like. However,recently, some techniques relating to the automatic programmingapparatus that creates the NC machining program by the CAD data havebeen proposed.

For example, in Japanese Patent Application Laid-open No. 2002-189510,feature data of a machined product is extracted from the CAD data to seta machining process and a machining area for each machining process,material data and a machining model for each machining process arecreated, the created machining process data and machining model data arestored, tool path data is created based on the machining process data,workpiece data, machining model data, tool data, and cutting conditiondata, to create virtual workpiece-shape data after completing therespective processes, as well as creating fabrication information basedon the created process data, workpiece data, tool path data, and virtualworkpiece-shape data.

In Japanese Patent Application Laid-open No. 2002-268718, when amachining path for machining a workpiece based on a three-dimensionalCAD data of a part is created, machining information for all portions tobe machined in a shape indicated by the three-dimensional CAD data isextracted, the extracted machining information is edited to determine amachining process, and the machining path is created based on thedetermined machining process.

In such type of automatic programming apparatus, it is desired toautomatically select an optimum workpiece corresponding to a producteasily.

In Japanese Patent Application Laid-open No. H10-207523, someworkpiece-shapes expressed by a three-dimensional solid model are storedin a preparation workpiece-shape database, and workpiece-shape dataspecified by an operator is taken out from the preparationworkpiece-shape database, deformed to a size instructed by the operator,and stored in the workpiece-shape database.

In Japanese Patent Application Laid-open No. H10-207523, however, sincethe operator selects the workpiece from the workpiece-shape data, longtime is required for selecting the work, thereby deteriorating theworking efficiency.

The present invention has been achieved in order to solve the aboveproblems, and it is therefore an object of the invention to provide anautomatic programming method and device that can automatically selectoptimum workpiece data from the workpiece database, thereby enablingefficient programming operation.

DISCLOSURE OF INVENTION

An automatic programming method according to one aspect of the presentinvention, which is for selecting workpiece data from a workpiecedatabase in which a material, a shape, and a dimension of a workpieceare registered, creating a workpiece model for lathe turning based onthe selected workpiece data, and creating a program for controlling anumerical control device based on a product model for lathe turning andthe created workpiece model, includes workpiece selecting includingselecting workpiece data involving a product shape and having a smallestdiameter for lathe turning around a turning axis from the workpiecedatabase, by comparing dimension data of the workpiece model withdimension data of the product model in a state in which the productmodel is arranged on the turning axis and the workpiece model isarranged so that a center axis of each workpiece matches a center of theturning axis, and selecting, when there is a plurality of workpiece datainvolving the product shape and having the smallest diameter for latheturning around the turning axis, workpiece data having a length equal toor longer than the product shape and a shortest length; and creating theworkpiece model for lathe turning based on the selected workpiece data.

According to the present invention, minimum workpiece data involving theproduct shape is automatically selected from the workpiece database, inthe state that the product model is arranged on the turning axis forturning and the work model for turning created based on the workpiecedata is arranged so that the central axis of each work matches thecenter of the turning axis for turning. As a result, optimum workpiecedata can be selected in the state that a product and a work are actuallyarranged on a machine.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of a configuration of an automatic programmingapparatus;

FIG. 2 is a block diagram of an NC unit having the automatic programmingapparatus built therein;

FIG. 3 is a flowchart of an operation procedure of the automaticprogramming apparatus according to a first embodiment of the presentinvention;

FIG. 4 is a schematic for illustrating an example of a menu selectionmain screen;

FIG. 5 is a schematic for illustrating an example of an extension menuof the menu selection main screen;

FIG. 6 is a schematic for illustrating an example of a productshape-reading screen;

FIG. 7 is a schematic for illustrating an example of aworkpiece-shape-setting screen;

FIG. 8 is a table of an example of stored data in workpiece-shapedatabase;

FIG. 9 is a schematic for illustrating a relation between end-facemachining and end-face machining allowance set value;

FIG. 10 is a flowchart of an automatic selection processing procedure ofa round bar workpiece model;

FIG. 11 is a schematic for illustrating an automatic-selectionprocessing procedure shown in FIG. 10;

FIG. 12 is a flowchart of the automatic selection processing procedureof a hexagonal bar workpiece model;

FIG. 13 is a schematic for illustrating the automatic-selectionprocessing procedure shown in FIG. 12;

FIG. 14 is a schematic for illustrating an example of theworkpiece-shape-setting screen for explaining another selectionprocessing procedure of the workpiece model;

FIG. 15 is a flowchart of another automatic selection processingprocedure of the workpiece model;

FIG. 16 is a schematic for illustrating another example of aworkpiece-shape-forming dialog;

FIG. 17 is a schematic for illustrating a display mode in aworkpiece-material input column;

FIG. 18 is a schematic for illustrating a shift of focus between a datainput column and a list box of workpiece database;

FIG. 19 is a flowchart of an operation procedure in a partial-workpiecesetting mode;

FIG. 20 is a schematic for illustrating an example of apartial-workpiece setting screen;

FIG. 21 is a schematic for illustrating a partial-workpiece settingprocessing;

FIG. 22 is a schematic for illustrating the partial-workpiece settingprocessing;

FIG. 23 is a schematic for illustrating an example of a product modelbefore the partial-workpiece setting processing;

FIG. 24 is a partially enlarged view of the product model shown in FIG.23;

FIG. 25 is a schematic for illustrating a model after thepartial-workpiece setting processing of the product model shown in FIG.24;

FIG. 26 is a schematic for illustrating an example of a fixture settingmenu;

FIG. 27 is a flowchart of an operation procedure of a fixture (jig)setting processing;

FIG. 28 is a schematic for illustrating an example of types of theworkpiece end-face shape and a claw pattern selection table;

FIG. 29 is a schematic for illustrating an example of a fixture settingwindow;

FIG. 30 is a flowchart of a procedure of a holding diameter calculation;

FIG. 31 is a schematic for illustrating a concept of a holding diametercalculation;

FIG. 32 is a flowchart of an automatic registration processing of theproduct model and the workpiece model;

FIG. 33 is a schematic for illustrating a display content of aregistration screen for performing the automatic registration processingof the product model and the workpiece model;

FIGS. 34A to 34E are schematics for illustrating a lathe-turning surfaceand a lathe-turning surface diameter;

FIG. 35 is a schematic for illustrating a Z reversal processing;

FIG. 36 is a schematic for illustrating a shape shift menu;

FIG. 37 is a schematic for illustrating a shape shift dialog;

FIG. 38 is a flowchart of a process division processing;

FIG. 39 is a schematic for illustrating a screen on which acharacteristic is displayed;

FIG. 40 is a schematic for illustrating a ½ section of a model in whicha process dividing spot is specified;

FIG. 41 is a flowchart of another example of the automatic processingfor dividing the process;

FIGS. 42A to 42D are schematics for illustrating the concept of theautomatic processing for dividing the process shown in FIG. 41;

FIG. 43 is a schematic for illustrating the fixture setting processingin a second process;

FIGS. 44A and 44B are schematics for illustrating an automaticdetermination processing of a through hole and two holes;

FIG. 45 is a schematic for illustrating an example of machining processexpansion for an inner diameter portion;

FIG. 46 is a schematic for illustrating point machining of an areabetween claws of a chuck;

FIG. 47 is a flowchart of tool selection processing;

FIG. 48 is a schematic for illustrating an edit processing with respectto a non-expandable shape;

FIG. 49 is a schematic for illustrating a program editing screen;

FIG. 50 is a flowchart of highlight processing in a three-dimensionaldisplay section of a machining unit;

FIGS. 51A and 51B are schematics for illustrating a processing forinserting the shape selected by the three-dimensional display sectioninto a cursor position in an editor section as a shape sequence;

FIG. 52 is a flowchart of shape sequence insertion processing;

FIG. 53 is a schematic for illustrating a state in which the shapesequence is inserted into the editor section;

FIG. 54 is a schematic for illustrating the program editing screen;

FIG. 55 is a flowchart of unit insertion processing;

FIG. 56 is a block diagram of a configuration of the automaticprogramming apparatus according to a second embodiment; and

FIG. 57 is a flowchart of an operation procedure of the automaticprogramming apparatus according to the second embodiment.

BEST MODE(S) FOR CARRYING OUT THE INVENTION

Exemplary embodiments of an automatic programming method and anautomatic programming apparatus according to the present invention areexplained below in detail with reference to the accompanying drawings.

FIG. 1 is a block diagram of a configuration of an automatic programmingapparatus according to a first embodiment of the present invention. Anautomatic programming apparatus 100 includes, as a basic component, NCcreating software for directly fetching data relating to a product shapeand a workpiece-shape from CAD data, and creating an NC creation programfor machining a product from a material (workpiece) in an interactivemode with an operator, by various data such as the fetched product shapedata and workpiece-shape data. The automatic programming apparatus isinstalled in a computer such as a microcomputer. The NC creation programis described in a predetermined language higher than the NC program.

The automatic programming apparatus 100 can be applied to a two-spindlemachine tool having two spindles, that is, a main spindle and asub-spindle, and a one-spindle machine tool having only the mainspindle. However, the automatic programming apparatus applied to thetwo-spindle machine tool having twp spindles, the main spindle and thesub-spindle, will be explained in the first embodiment. The automaticprogramming apparatus applicable to both the two-spindle machine tooland the one-spindle machine tool will be explained in the secondembodiment.

The automatic programming apparatus 100 is applicable to the machinetool that performs lathe-turning for rotating a workpiece and shaving itin a round shape, boring for rotating the workpiece and boring therein,milling for fixing the workpiece and rotating an edged tool to shave thework, and surface machining. The automatic programming apparatus 100 isalso applicable to combined machining in which lathe-turning and millingare combined.

FIG. 1 shows a state in which the automatic programming apparatus 100 isinstalled in a computer, and the automatic programming apparatus 100 isconnected to an NC unit 200 that is operated by an NC program via acommunication interface 23.

In FIG. 1, a product shape database 1, a workpiece-shape database 2, anda tool database 3 are registered in a built-in memory or an externalmemory of the microcomputer in which the automatic programming apparatus100 is installed. Pieces of product shape data shown inthree-dimensional CAD data (three-dimensional solid model data) areregistered and stored in the product shape database 1. Various types ofdata, such as the material, shape (columnar, square, hexagonal and thelike), and size (outer diameter, inner diameter, length, and the like)are registered and stored in the workpiece-shape database 2, for eachwork. Tool data is registered and stored in the tool database 3.

The microcomputer, in which the automatic programming apparatus isinstalled, includes a display apparatus 20, an input unit 21 such as akeyboard and a mouse, and an output unit 22 such as a printer, and themicrocomputer is connected to external equipment such as the NC unit 200via the communication interface 23.

A program unit, which is the basic component of the automaticprogramming apparatus 100, includes a product-shape-input processingunit 10, a workpiece-shape-input processing unit 11, a jig-settingprocessing unit 12, a registration processing unit 13, aprocess-division processing unit 14, a process-expansion processing unit15, a tool-selection processing unit 16, a non-expandable-shape-editingprocessing unit 17, a program-editing processing unit 18, and aprogram-expansion processing unit 19.

The product-shape-input processing unit 10 displays a product shapeinput screen for selecting the product shape data (product model) by anoperator, and when the operator selects the necessary product shape datafrom a plurality of product shape data formed of the product shapedatabase 1 or three-dimensional solid model data stored in anotheroptional memory, the product-shape-input processing unit 10 executesprocessing such as three-dimensionally displaying the selected productshape data.

The workpiece-shape-input processing unit 11 displays a workpiece-shapeinput screen for selecting the workpiece-shape data (workpiece model) bythe operator, allows the necessary workpiece-shape data to be selectedautomatically or by the operator from the plurality of workpiece-shapedata formed of the product shape database 1 or the three-dimensionalsolid model data stored in another optional memory, and executesprocessing such as three-dimensionally displaying the selectedworkpiece-shape data. The workpiece-shape-input processing unit 11 has apartial-workpiece setting function for creating thickened workpiece dataused for casting and the like based on the product shape data.

The jig-setting processing unit 12 displays jig models formed of a chuckand a claw, and workpiece models, prepares a plurality of jigarrangement patterns corresponding to the workpiece-shapes, determinesthe jig arrangement by allowing the operator to select a jig arrangementpattern, and calculates a holding position and a holding diameter, totransmit the information to the NC side.

The registration processing unit 13 performs processing forautomatically arranging the product model in the workpiece model held bya first chuck at a first process (step performed by the main spindle).The registration processing unit 13 also performs processing forautomatically arranging the product model in the workpiece model held bya second chuck at a second process (step performed by a sub-spindle).

The process-division processing unit 14 performs process divisionprocessing at the time of machining by the two-spindle machine toolhaving two spindles, the main spindle and the sub-spindle, and processdivision processing at the time of machining by the one-spindle machinetool having only the main spindle. In the case of the two-spindlemachine tool, the dividing position between the first process performedby the main spindle and the second process performed by the sub-spindleis specified by an outer diameter and an inner diameter. In the case ofthe one-spindle machine tool, the dividing position of the first processfor performing machining by holding one end of a workpiece model by themain spindle, and the second process for performing machining by holdingthe other end of the workpiece model by the main spindle, is specifiedby an outer diameter and an inner diameter, respectively.

The process-expansion processing unit 15 executes processing forbreaking down a series of machining operations including lathe-turning,point machining, surface machining, and chamfering, referred to asmachining modes, into machining units in which continuous machining isperformed with the same main spindle and the same tool.

The tool-selection processing unit 16 performs tool determinationprocessing for selecting an optimum tool for each processing position(machining unit) from the tool database 3, and also determines cuttingcondition corresponding to the tool.

The program-expansion processing unit 19 creates an NC creation programdescribed by the predetermined language based on a combination of aplurality of process-expanded machining units, the determined toolinformation, and the cutting condition.

The non-expandable-shape-editing processing unit 17 performs editingworkpiece for converting the non-expandable shape, which cannot beautomatically expanded into the machining unit in the process expansionprocessing, to some machining unit. The program-editing processing unit18 is for performing the editing processing of the created NC creationprogram.

The automatic programming apparatus 100 is connected to the NC unit 200via the communication interface 23 in FIG. 1, however as shown in FIG.2, the automatic programming apparatus 100 can be installed into the NCunit 200. In this case, the automatic programming apparatus 100 isconnected to an NC controller 201 in the NC unit 200.

FIG. 3 is a flowchart of a creation procedure of the NC creation program(machining program) executed by the automatic programming apparatus 100shown in FIGS. 1 and 2. The details of the creation procedure of the NCcreation program executed by the automatic programming apparatus will beexplained for each process, with reference to FIG. 3.

A menu selection main screen 8 displayed first when activating theautomatic programming apparatus 100 will be explained. FIG. 4 is aschematic for illustrating an example of the menu selection main screen8.

As shown in FIG. 4, the menu selection main screen 8 includes a treedisplay unit 4, a 3D display unit 5, a menu display unit 6, and thelike. A name of a product file, a name of a workpiece file, a jig(fixture) file, file names of respective machining units expanded to themachining units, and the like are tree-displayed on the tree displayunit 4. The shape data of the product file, workpiece file, jig file, ormachining unit file selected on the tree display unit 4 arethree-dimensionally (3D) displayed on the 3D display unit 5.

The menu display unit 6 includes a SET PRODUCT SHAPE button 6 a, a SETWORKPIECE SHAPE button 6 b, a SET FIXTURE button 6 c, an ADJUST POSITIONbutton 6 d, a DIVIDE PROCESS button 6 e, an EXPAND UNIT button 6 f, anEDIT UNIT button 6 g, a CREATE PROGRAM button 6 h, and the like. The SETPRODUCT SHAPE button 6 a is a button for shifting to a product shapesetting mode, wherein processing such as reading a 3D-CAD model of theproduct shape is executed. The SET WORKPIECE SHAPE button 6 b is abutton for shifting to a workpiece-shape setting mode, wherein theworkpiece-shape to be machined is selected and set. The SET FIXTUREbutton 6 c is a button for shifting to a fixture setting mode, wherein afixture (chuck, claw) for holding the workpiece is set. The ADJUSTPOSITION button 6 d is a button for shifting to a registration mode,wherein positioning of the product and the workpiece is executed. TheDIVIDE PROCESS button 6 e is a button for shifting to a process dividingmode, wherein a dividing position of the first process and the secondprocess is set. The EXPAND UNIT button 6 f is a button for shifting to aunit expanding mode, wherein automatic expansion of the machining unitis executed from the set information. The EDIT UNIT button 6 g is abutton for shifting to a unit editing mode, wherein editing of theexpanded machining unit is executed. The CREATE PROGRAM button 6 h is abutton for shifting to a program creating mode, wherein the NC creationprogram is created from the expanded and edited unit.

The menu display unit 6 includes a menu changeover button 6 k. Otherdisplay menus shown in FIG. 5 are changed over and displayed on the menudisplay unit 6 by operating the menu changeover button 6 k. A DISPLAYSECTION button 7 a is a button for section-displaying the display dataof the 3D display unit 5, and a SPECIFY SECTION DISPLAY ANGLE button 7 bis a button for executing section display at a specified angle. A ZOOMbutton 7 c, a ROTATION button 7 d, and a SHIFT button 7 e are for zoom,rotating, and shifting the display data on the 3D display unit 5. AFITTING button 7 f is a button for displaying the displayed 3D shape sothat the whole shape is fitted in the middle of the screen, with theposture thereof unchanged. A SWITCH DIMENSION LINE DISPLAY button 7 g isa button for displaying or non-displaying a dimension line with respectto the displayed 3D shape. A FRONT button 7 h, a BACK button 7 i, a LEFTbutton 7 j, a RIGHT button 7 k, a PLANE button 7 l, and a BOTTOM button7 m are for performing front display, back display, left side display,right side display, plane display, and bottom display of the displayed3D shape. A FIRST SPINDLE 3D DISPLAY button 7 n is a button fordisplaying the displayed 3D shape in a direction as seen toward thefirst spindle, and a SECOND SPINDLE 3D DISPLAY button 7 p is a buttonfor displaying the displayed 3D shape in a direction as seen toward thesecond spindle.

In the automatic programming apparatus, each process is normallyexecuted according to the procedure shown in FIG. 3, after displayingthe menu selection main screen 8. That is, respective steps are executedin order of product shape input processing (step S100), workpiece-shapesetting processing (step S101), first process jig setting processing(step S102), registration processing (step S103), process divisionprocessing (step S104), second process jig setting processing (stepS105), registration processing (step S106), process expansion processing(step S107), tool automatic setting processing (step S108), programexpansion processing (step S109), non-expandable shape editingprocessing (step S110), and program edit processing (step S111). Therespective processing will be explained in detail for each step.

(1) Input of Product Shape (Step S100)

The product shape input processing is started by turning ON the SETPRODUCT SHAPE button 6 a on the menu selection main screen 8 shown inFIG. 4. When the SET PRODUCT SHAPE button 6 a on the menu selection mainscreen 8 shown in FIG. 4 is turned ON, the screen is changed over to aproduct shape read screen 30 for the product shape input processingshown in FIG. 6. The product shape input processing is mainly executedby the product-shape-input processing unit 10 in FIG. 1.

An operator operates the input unit 21, with the product shape readscreen 30 for selecting the product shape data being displayed, toselect three-dimensional CAD data (product model) corresponding to theproduct in the following manner.

First, the operator presses a READ PRODUCT SHAPE button 31 positioned onthe leftmost side of a plurality of buttons arranged below the productshape read screen 30. As a result, a product shape-reading dialog 32 isdisplayed on the left side and a three-dimensional view 33 fordisplaying the product shape (product model) corresponding to theselected three-dimensional CAD data in a wire frame format is displayedon the right side.

The product shape-reading dialog 32 has a list box 34 for displaying alist of CAD files registered in the product shape database 1. When theoperator has selected an optional file in the list box 34, a preview ofthe product shape corresponding to the selected file is displayed on thethree-dimensional view 33. In the preview, respective dimensions of theproduct in the X, Y, and Z directions are displayed on thethree-dimensional view 33. Respective three-dimensional CAD data hasshape information and color information (display color), and attributedata relating to the machining is added to the respective pieces ofshape information. The attribute data includes screw, coarseness signs,grinding off, chamfering, chamfering of holes, hole information (drill,reamer, end mill, boring, and tapping), part number, material, names ofarticles, and the like. Adjustment (change of machining order) of theprocess expansion result is executed by the attribute data. The CAD dataincludes the color information (display color), and the roughness of thefinished surface can be identified according to the display color.

The current directory is displayed on a directory display unit 35positioned above the list box 34 of the file list. The file list in thedirectory displayed on the directory display unit 35 is displayed in thelist box 34. When the operator presses a CHANGE FOLDER button 36, afolder-changing dialog (not shown) is displayed, and the currentdirectory can be changed by operating the dialog.

When the operator presses a SELECT button 37, the CAD file selected inthe list box 34 is read into a storage area of the automatic programmingapparatus, an image of the product corresponding to the read CAD file iscreated, and the created product shape (product model) is displayed onthe three-dimensional view 33. At the time of display, respectivedimensions of the product model in the X, Y, and Z directions aredisplayed on the three-dimensional view 33. Furthermore, an automaticadjustment mode at the time of creating the image of the product shapeis included, and if the operator selects YES in item 29 in thisautomatic adjustment mode, the direction of the product and the displayposition of the product are automatically adjusted on thethree-dimensional view 33, in the product shape creation processing.

One or more directories are provided inside or outside the computer asan area for the product shape database 1, so that an optionalthree-dimensional CAD data can be newly registered in these directories,or already registered product shape data can be changed andre-registered.

(2) Setting of Workpiece-Shape (Step S101)

The workpiece-shape setting processing is started by turning ON the SETWORKPIECE SHAPE button 6 b on the menu selection main screen 8 shown inFIG. 4, and when the SET WORKPIECE SHAPE button 6 b is turned ON, forexample, the screen is changed over to a workpiece-shape setting screenshown in FIG. 7. The workpiece-shape setting processing is mainlyexecuted by the workpiece-shape-input processing unit 11 in FIG. 1.

FIG. 8 is a diagram of an example of the workpiece-shape data registeredin the workpiece-shape database 2. The workpiece-shape data includes, asshown in FIG. 8, materials, types of the shape (columnar, square,hexagonal and the like), size (outer diameter, inner diameter, length,and the like), and the like.

A workpiece setting menu 9 a is displayed on a workpiece-shape settingscreen 9 shown in FIG. 7. The workpiece setting menu 9 a includes aWORKPIECE DATABASE button 9 b, a SET PARTIAL WORKPIECE button 9 c, aREAD WORKPIECE MODEL button 9 d, a SET WORKPIECE MATERIAL button 9 e, anEDIT button 9 f, and a CHANGE MACHINING ALLOWANCE button 9 g.

The WORKPIECE DATABASE button 9 b is a button for performing automaticselection of the work, described below. The SET PARTIAL WORKPIECE button9 c is a button for creating a workpiece model in which a product modelused for casting or the like is partially thickened. The READ WORKPIECEMODEL button 9 d is a button for reading workpiece data registered inthe workpiece-shape database 2 or optional workpiece data stored in anexternal storage unit to set the workpiece data as a workpiece-shape.The SET WORKPIECE MATERIAL button 9 e is a button for manually settingthe material. The EDIT button 9 f is a button for registering necessaryworkpiece data in the workpiece-shape database 2 or editing theregistered workpiece data. The CHANGE MACHINING ALLOWANCE button 9 g isa button for changing the set value for a machining allowance of an endface.

When the operator presses the WORKPIECE DATABASE button 9 b, a workpiecedatabase dialog 300 is displayed. The dimensions of the maximum outerdiameter of the product shape in the X, Y, and Z directions, determinedby the product shape input processing executed at step S100 aredisplayed in a product-shape-dimension display section 301 in theworkpiece database dialog 300.

The workpiece-shape data registered in the workpiece-shape database 2 isdisplayed in a workpiece-list display section 302 in the workpiecedatabase dialog 300. A workpiece having a minimum diameter including theouter diameter of the product is selected from the displayedworkpiece-shape data, and the selected workpiece is highlighted as shownby reference sign 303. In this case, a round bar is selected by theoperator as the workpiece-shape, the workpiece-shape data of theround-bar workpiece is displayed, and the workpiece having the minimumdiameter including the outer diameter of the product is selected fromthe round-bar workpiece data, highlight-displayed. When theworkpiece-shape is not specified, a workpiece having the minimumdiameter including the outer diameter of the product is selected fromall workpiece-shape data, such as round-bar work, square work, andhexagonal work, registered in the workpiece-shape database 2.

When the operator does not like the automatically selected andhighlight-displayed workpiece data, the operator appropriately performssorting by items of number, workpiece material, workpiece-shape, outerdiameter, inner diameter, and length, to select desired workpiece data.When the operator presses an OK key 304, in a state with the desiredworkpiece data being selected (the selected workpiece data ishighlight-displayed), the highlighted workpiece data is selected, and anend-face machining-allowance dialog 305 is opened.

In the end-face machining-allowance dialog 305, workpiece number,workpiece material, workpiece-shape, outer diameter, inner diameter,length, and end-face machining allowance of the selected workpiece aredisplayed, and in the initial state, the machining allowance is 0millimeter.

The set value of the end-face machining allowance is for end-facemachining for cutting off the workpiece end at the beginning oflathe-turning. That is, since the end of an unmachined workpiece is notcut off smoothly, end-face machining is executed at the beginning oflathe-turning. When the operator inputs a desired value as a set valueof the end-face machining allowance, and presses the OK button, anend-face machining program for removing the set end-face machiningallowance by lathe-turning is created at the time of creating themachining program.

FIG. 9 is a schematic for illustrating a concept of the end faceprocessing. A workpiece model WM is overlapped on a product model SM inFIG. 9. In FIG. 9, an end-face machining allowance TM1 is a value set bythe end-face machining-allowance dialog 305, and an end-face machiningallowance TM2 on the other side is a value obtained by subtracting theproduct length and TM1 from the workpiece length.

FIG. 10 is a diagram of a procedure in automatic workpiece selectionprocessing when the WORKPIECE DATABASE button 9 b is pressed, and inthis case, is a procedure when the round bar is specified as theworkpiece-shape.

Respective distances from a program origin Pc (preset in the productshape input processing) of the product model determined in the productshape input processing executed at step S100 to the fringe area of theproduct model in a direction perpendicular to a turning axis (Z axis) ofthe product model is calculated, to select the maximum distance Lmaxfrom a plurality of calculated distances (step S120). That is, as shownin FIG. 11, distances from the program origin Pc to a plurality ofpoints PW1 to PWi on the fringe area of the product model SM in adirection perpendicular to the turning axis are respectively determinedto select the maximum distance Lmax from the distances. In FIG. 11, apivot (Z axis) extends in a direction perpendicular to the page.

A plurality of round bar data registered in the workpiece-shape database2 is displayed in the workpiece-list display section 302 in theworkpiece database dialog 300, and a round-bar workpiece whose radiusequal to or larger than Lmax and having a minimum diameter is selectedfrom the displayed round bar data (step S121).

When the selected round-bar workpiece is only one (step S122), theworkpiece data corresponding to the selected round-bar workpiece ishighlight-displayed in the workpiece-list display section 302 (stepS124). However, when there is a plurality of selected round bar data, around-bar workpiece having a length equal to or longer than the productmodel and shortest among the round-bar works (step S123). The workpiecedata corresponding to the selected one or more round-bar works arehighlight-displayed in the workpiece-list display section 302 (stepS124).

A procedure in the automatic workpiece selection processing when ahexagonal bar is selected as the workpiece-shape will be explained withreference to FIGS. 12 and 13. In this case, as shown in FIG. 13, theposture of the product model SM with respect to the hexagonal-barworkpiece model WM is determined, so that the program origin Pc of theproduct model SM matches the center Po of one hexagonal-bar workpiecemodel WM (step S130). Also in this case, the pivot extends in adirection perpendicular to the page.

The respective sides of the hexagonal-bar workpiece model WM are shiftedin parallel until the sides touch the product model SM, to determinedistances L1 to L6 between the parallel-shifted respective line segmentsLa1 to La6 and the program origin Pc of the product model SM in thedirection perpendicular to the turning axis. The longest distance Lmaxis then obtained from these distances (step S131).

Pieces of hexagonal bar data registered in the workpiece-shape database2 are displayed in the workpiece-list display section 302 in theworkpiece database dialog 300, to select a hexagonal-bar workpiecehaving an opposite side length (a distance between opposite sides) equalto or larger than 2 Lmax and the shortest opposite side length, from thedisplayed hexagonal bar data (step S132).

When only one hexagonal-bar workpiece is selected (step S133), theworkpiece data corresponding to the selected hexagonal-bar workpiece ishighlight-displayed in the workpiece-list display section 302 (stepS135). However, when there is a plurality of selected hexagonal bardata, a hexagonal-bar workpiece having a length equal to or longer thanthe product model and shortest among the hexagonal-bar works is selected(step S134). The workpiece data corresponding to the selected one ormore hexagonal-bar works are highlight-displayed in the workpiece-listdisplay section 302 (step S135).

In the case of FIG. 7, all data registered in the workpiece-shapedatabase 2 is displayed in the workpiece-list display section 302, andone or more minimum workpiece data involving the product model ishighlight-displayed from the displayed data, but as shown in FIG. 14,only the works involving the product model can be displayed in theworkpiece-list display section 302, from all data registered in theworkpiece-list display section 302. When there is a plurality of worksinvolving the product model, a workpiece having the smallest diameterand the smallest length, that is, the one whose chipped amount at thetime of machining is small is highlight-displayed at the uppermostposition in the workpiece-list display section 302, and hereunder, thedisplay sequence is sorted out in order of from the one whose chippedamount is small from the upper position. By performing the display inthis manner, the operator can easily select a workpiece contributing tocost reduction, with a fewer chipped amount at the time of machining.

Another embodiment of the workpiece model input setting processing willbe explained with reference to FIGS. 15 to 18. The workpiece-shapesetting screen shown in FIGS. 16 to 18 does not operate synchronizedwith the workpiece-shape setting screen 9 shown in FIG. 7, and theworkpiece-shape setting screen shown in FIGS. 16 to 18 and theworkpiece-shape setting screen 9 shown in FIG. 7 are screens of aso-called separate version.

When the workpiece data is registered in the workpiece-shape database 2,upon pressing an appropriate button (not shown) (corresponding to theEDIT button 9 f on the workpiece-shape setting screen 9 shown in FIG.7), a workpiece data registration screen (not shown) is displayed. Theoperator appropriately operates the workpiece data registration screen,to register required workpiece data as shown in FIG. 8 in theworkpiece-shape database 2. Three-dimensional CAD data can be also inputin the workpiece-shape database 2 as workpiece data.

On the other hand, when the workpiece data is manually selected from theworkpiece-shape database 2, the operator presses an appropriate button(corresponding to the READ WORKPIECE MODEL button 9 d shown in FIG. 7).When this button is pressed, a workpiece-shape creating dialog 40 shownin FIG. 16 is displayed.

The workpiece-shape creating dialog 40 has a data input column 41 forinputting the workpiece material, workpiece-shape, outer diameter of thework, inner diameter of the work, length, and end-face machiningallowance, a list box 42 in which data registered in the workpiece-shapedatabase 2 is displayed, and a product-size display column 43 in whichthe XYZ dimensions of the product shape are displayed.

A workpiece-material input column 44 and a workpiece-shape input column45 in the data input column 41 are formed of a combo box, and theoperator selects the necessary one from the list in the combo box forthe workpiece material and the workpiece-shape (round bar, square bar,and the like). An outer-diameter input column 46, an inner-diameterinput column 47, a length input column 48, and an end-facemachining-allowance input column 49 are formed of an edit box, and arequired figure is directly input to each column.

When the operator selects a required material and a workpiece-shape inthe workpiece-material input column 44 and the workpiece-shape inputcolumn 45, the workpiece-shape-input processing unit 11 searches theworkpiece-shape database 2, using the selected material andworkpiece-shape as a keyword, to extract the workpiece data matching theselected material and workpiece-shape, of multiple workpiece data in theworkpiece-shape database 2, and lists/displays the extracted workpiecedata in the list box 42.

The operator selects the required workpiece data from the list box 42,and for example, when the operator presses an input (enter) key on akeyboard, which is the input unit 21, the respective data in theouter-diameter input column 46, the inner-diameter input column 47, andthe length input column 48 are automatically updated by the outerdiameter, the inner diameter, and the length of the selected workpiecedata. However, when the operator selects a workpiece having a zerolength and presses an input key, the length of the workpiece is notchanged.

The respective operation above can be performed by a pointer such as amouse, but the following short cut key function can be provided. Thatis, when focus is in the workpiece-material input column 44 and theworkpiece-shape input column 45, and for example, when a cursor shiftkey “↑” or “↓” is pressed, as shown in FIG. 17, the combo boxes in theworkpiece-material input column 44 and the workpiece-shape input column45 are opened, and the list is displayed. Furthermore, while the listsin the combo boxes in the workpiece-material input column 44 and theworkpiece-shape input column 45 are opened, for example, if the inputkey is pressed, as shown in FIG. 17, the list is closed. Even when focusis not in the combo box, the list is closed likewise. For example, whena TAB key is pressed, focus is shifted among the workpiece-materialinput column 44, the workpiece-shape input column 45, the outer-diameterinput column 46, the inner-diameter input column 47, the length inputcolumn 48, and the end-face machining-allowance input column 49.Furthermore, when focus is in any of the workpiece-material input column44, the workpiece-shape input column 45, the outer-diameter input column46, the inner-diameter input column 47, the length input column 48, andthe end-face machining-allowance input column 49, if a cursor shift key“→” is pressed, as shown in FIG. 8, focus is shifted to the list box 42in the workpiece database. When the focus is to be returned to theoriginal position from the list box 42 in the workpiece database, acursor shift key “←” is pressed.

Thus, the operator inputs appropriately desired data in the data inputcolumn 41 in the workpiece-shape creating dialog 40, so that theoperator can manually set desired workpiece data.

After finishing data input setting to the data input column 41, when theoperator presses a CREATE button 58, the input-set workpiece data isread into a storage area of the automatic programming apparatus from theworkpiece-shape database 2, to create an image of a workpiececorresponding to the read workpiece data, and the createdworkpiece-shape is displayed on the three-dimensional view (not shown).

In the manual setting by the operator as described above, it is notassured that the optimum smallest workpiece that can be machined into aproduct shape can be selected. Therefore, in the product-size displaycolumn 43 in the workpiece-shape creating dialog 40, an APPLY PRODUCTSHAPE button 50 is provided for automatically selecting the optimumsmallest workpiece that can be machined into the product shape selectedby the operator. In the product-size display column 43, the XYZdimensions of the product shape set in the product shape inputprocessing at step S100 are displayed.

The automatic selection processing of a workpiece model based onpressing of the APPLY PRODUCT SHAPE button 50 will be explained withreference to FIG. 15. First, data is input to the workpiece-materialinput column 44 and the workpiece-shape input column 45, to select theworkpiece material and the workpiece-shape. Furthermore, dimension dataof the product shape is input (step S140). In the case of the automaticprogramming apparatus, since the selection processing of the productshape is finished at this point in time, the dimensions of the inputproduct shape are displayed in the product-size display column 43.

In this state, when the APPLY PRODUCT SHAPE button 50 is pressed (stepS141), the workpiece-shape-input processing unit 11 searches theworkpiece-shape database 2, using the material and workpiece-shapeselected in the workpiece-material input column 44 and theworkpiece-shape input column 45 as a keyword, to extract the workpiecedata matching the selected material and workpiece-shape, of manyworkpiece data in the workpiece-shape database 2 (step S142). Theworkpiece-shape-input processing unit 11 selects a workpiece involvingthe product shape, that is, having a larger size than that of theproduct, from one or more extracted works extracted by comparing thedimension data of the extracted one or more works and the dimension dataof the product, and further selects a workpiece having the minimum sizefrom one or more works capable of involving the product shape (stepS143). As a method of selecting the workpiece having the minimum size,the method explained with reference to FIGS. 10 and 12 is used.

When the workpiece selection processing is finished, theworkpiece-shape-input processing unit 11 updates the respective data inthe outer-diameter input column 46, the inner-diameter input column 47,the length input column 48, and the end-face machining-allowance inputcolumn 49 with the values of the finally selected workpiece data. Thus,the optimum smallest workpiece capable of machining the product shape isautomatically selected. A workpiece model is created based on theselected workpiece data.

Since the smallest workpiece data involving the product shape isautomatically selected from the workpiece database, the time and laborof the operator to manually select the workpiece data can be saved,thereby enabling efficient programming operations.

A partial-workpiece setting mode executed by pressing the SET PARTIALWORKPIECE button 9 c on the workpiece-shape setting screen 9 shown inFIG. 7 will be explained with reference to FIGS. 19 to 25. In thispartial-workpiece setting mode, a product model is displayed at the timeof selecting the work, to allow the operator to select and specify theportion to be thickened and the thickness of this portion from thedisplayed product model, so that a model in which only the selected andspecified portion is thickened to have the specified thickness iscreated, and the created model is registered as the workpiece model.

In other words, in casting and molding material machining, products areoften manufactured by creating a workpiece having a shape close to thedesired product, and adding machining such as lathe-turning to thecreated work. The product manufacturer side asks a workpiecemanufacturer to supply such a workpiece having a shape close to thedesired product. On the other hand, in the automatic programmingapparatus, a machining path and an NC creation program cannot beprepared, unless the product model and the workpiece model are defined.Therefore, it is necessary to define the workpiece model when performingcasting and molding material machining. In the partial work-setting mode(thickening mode), a workpiece model for the casting and moldingmaterial machining can be easily created.

The operation procedure in the partial work-setting mode will beexplained with reference to the flowchart shown in FIG. 19.

When the SET PARTIAL WORKPIECE button 9 c on the workpiece-shapesetting-screen 9 shown in FIG. 7 is pressed, a partial-workpiece settingdialog 51 as shown in FIG. 20 and a product model 3D display screen asshown in FIG. 21 are opened. The 3D-displayed product model is a productmodel selected in the product shape input processing at step S100.Normally, in the CAD data of the product model, a color attributedifferent for each surface is added, and each surface of the 3Ddisplayed product model is displayed with a color corresponding to theset color attribute, as shown in FIG. 21. In this case, in the productmodel shown in FIG. 21, green color attribute is set to the surfaces D1and D3, and red color attribute is set to the surfaces D2 and D4.

In FIG. 20, the partial-workpiece setting dialog 51 has a colorselection section 51 a, a machining-allowance setting section 51 b, andan OK button 51 c, and in the color selection section 51 a, all colorsset as the attribute for the product model are extracted and displayed.For example, the number of colors that can be set as the attribute is256×256×256. When the product model is expressed by 20 colors amongthese colors, the 20 colors are displayed in the color selection section51 a. In the product model shown in FIG. 21, if only the colorattributes of green (D1, D3) and red (D2, D4) are set, only the twocolors, green and red are displayed in the color selection section 51 a.

The operator selects the color corresponding to the portion, which theoperator wants to thicken, from the colors displayed in the colorselection section 51 a, to specify the necessary surface of the productmodel (step S150), and sets the thickness of the portion to be thickenedin the machining-allowance setting section 51 b (step S151). When theoperator presses the OK button 51 c, only the surface corresponding tothe selected color of the product model displayed on the 3D displayscreen is thickened by the machining allowance set in themachining-allowance setting section 51 b (step S152).

In the color selection section 51 a, when there is another selectedsurface, the processing of from steps S150 to S152 is repeatedsimilarly.

FIG. 22 is the product model shown in FIG. 21 in cross section (sideface). When green is selected in the color selection section 51 a, 10millimeters is set in the machining-allowance setting section 51 b, andthe OK button 51 c is pressed, as shown in FIG. 22, the surfaces D1 andD3 having the green attribute are thickened by 10 millimeters.Furthermore, when green is selected in the color selection section 51 a,5 millimeters is set in the machining-allowance setting section 51 b,and the OK button 51 c is pressed, the surfaces D2 and D4 having the redattribute are thickened by 5 millimeters.

When all surface selection is finished, it is determined whether thereare adjacent surfaces between the thickened surfaces (step S154). Whenthere are no adjacent thickened surfaces, the thickened model created by(repetition of) the processing of from steps S150 to S152 is registeredand set as the workpiece model (step S157).

On the other hand, when there are adjacent thickened surfaces, a dialog(not shown) for selecting either a curved surface (shown by solid lineE1 in FIG. 22) such as ellipse or circle, or a rectangular surface(shown by broken line E2 in FIG. 22) as a connecting surface between theadjacent surfaces is displayed, so that the operator selects the curvedsurface or the rectangular surface as the connecting surface. Theconnecting surface can be selected for each adjacent portion, or can becommonly selected as the curved surface or the rectangular surface forall adjacent portions. The adjacent thickened portions are thenconnected as shown in FIG. 22, by the selected connecting surface (stepS155). The thickened model is registered and set as the workpiece model(step S156).

FIG. 23 is one example of a part of the product model 3D-displayed atthe time of partial-workpiece setting mode. An enlarged view of part Fin FIG. 23 is shown in FIG. 24. A thickened model in which thickenedportions G1 to G4 are added is shown in FIG. 25.

In the above example, the color attribute is adopted as the displayattribute for specifying the respective surfaces of the product model,so as to select the surface to be thickened by the color attribute setfor the product model. However, various types of filling patterns suchas hatching can be set as the display attribute for the respectivesurfaces of the product model, and a desired surface to be thickened canbe selected by selecting these filling patterns. Furthermore, thesurface to be thickened can be selected by an operation of an input unitsuch as a mouse, and a machining allowance can be set with respect tothe selected surfaces.

In the partial-workpiece setting processing, a desired thickened modelis created by specifying the surface to be thickened, of the respectivesurfaces of the product model, and the thickness of the specifiedsurface to be thickened, so that the created thickened model can beregistered as the workpiece model. As a result, a workpiece model to beused in casting or the like can be easily created.

(3) First Process Jig Setting Processing (Setting of First Chuck andClaw, Step S102)

The jig setting processing (fixture setting processing) is started byturning on the SET FIXTURE button 6 c on the menu selection main screen8 shown in FIG. 4. When the SET FIXTURE button 6 c is turned on, fixturesetting is started, and for example, the menu is changed over to afixture setting menu 52 as shown in FIG. 26, and a claw-patternselection table 53 shown in FIG. 28 and a fixture setting window 54shown in FIG. 29 are displayed. The fixture setting processing is mainlyexecuted by the jig-setting processing unit 12 in FIG. 1. The firstprocess jig setting processing is for setting the jig at the firstprocess carried out by the main spindle of the two-spindle machine tool.

A jig model is formed of chuck models and claw models for holding thework. For the chuck shape data, in the case of the configuration of FIG.1, NC parameters (outer and inner diameters and width of the chuck) areobtained from the NC unit 200 via the communication interface 23 oroffline, and in the case of the configuration of FIG. 2, NC parameters(outer and inner diameters and width of the chuck) are obtained from theNC controller 201, and the outer and inner diameters and the width ofthe chuck are displayed by the obtained NC parameters, so that theoperator selects a desired chuck shape. For the claw, the number, theshape, the size, and the holding diameter of the claw are determinedaccording to the procedure shown in FIG. 27. The procedure shown in FIG.27 is executed by the jig-setting processing unit 12.

In the fixture setting menu 52 shown in FIG. 26, an SELECT OUTER CLAWbutton 52 a is a button for selecting an outer claw, an SELECT INNERCLAW button 52 b is a button for selecting an inner claw, and these haveexclusive relation, such that when one of these is selected, the otheris in a non-selection state. A CHANGE HOLDING DIAMETER/NUMBER OF CLAWSbutton 52 c is a button for changing the holding diameter and the numberof claws. A SET FIRST SPINDLE CLAW button 52 d is a button for settingthe claw of the first spindle (main spindle), and a SET SECOND SPINDLECLAW button 52 e is a button for setting the claw of the second spindle(sub-spindle). When the fixture setting menu 52 is initially displayed,the SELECT OUTER CLAW button 52 a and the SET FIRST SPINDLE CLAW button52 d are automatically selected and turned on. An EDIT CLAW button 52 fis a button used at the time of editing the claw data. A FINISH FIXTURESETTING button 52 g is a button for finishing the fixture settingprocessing.

In this case, since it is jig setting for the first process, the SETFIRST SPINDLE CLAW button 52 d is turned on, and either one of theSELECT OUTER CLAW button 52 a and the SELECT INNER CLAW button 52 b isturned on.

When these buttons are turned on, the jig-setting processing unit 12obtains the type (circular, square, hexagonal, and the like) of the endface of the workpiece and the dimension data of the workpiece model,from the workpiece model determined in the workpiece-shape settingprocessing at step S101 (step S160).

For the claw pattern displayed in the claw-pattern selection table 53shown in FIG. 28 (claw model pattern), at first, the claw pattern islargely divided into an outer claw pattern and an inner claw pattern,and then classified by type (circular, square, hexagonal, and the like)of the end face of the work, claw arrangement pattern (the number ofclaws, the holding portions by the claw (holding a corner, holding aflat surface, and the like). In FIG. 28, only the outer claw patternsare shown.

Not all claw patterns are displayed in the claw-pattern selection table53, and only claw patterns corresponding to the type of the workpieceend face of the workpiece model, of claw patterns corresponding to theselected one of the SELECT OUTER CLAW button 52 a and the SELECT INNERCLAW button 52 b, are displayed. For example, when a workpiece model ina shape of quadratic prism is set, only three claw patterns in themiddle row of the claw patterns shown in FIG. 28 are shown (step S161).The operator selects and specifies a desired claw pattern from the clawpatterns displayed here (step S162). As a result, the number of clawsand the holding portion by the claw (holding a corner or holding a flatsurface) are specified.

When the claw pattern is selected, registered data of one or more clawmodels corresponding to the selected claw pattern is extracted from thewhole registered data, and the extracted registered data is displayed ina list display section 54 a in the fixture setting window 54 shown inFIG. 29 (step S163). For example, when a claw pattern of a type ofsquare, four claws, and holding a flat surface is selected, only theregistered data of the claw model corresponding to the selected patternis displayed in the list display section 54 a.

The list display section 54 a includes a claw-number display section(claw number) in which a claw number of a registered claw model isdisplayed, a claw name display section in which the name of a registeredclaw shape (claw model) is displayed, a claw height display section inwhich the height of the registered claw shape is displayed, a clawlength display section in which the length of the registered claw shapeis displayed, a claw width display section in which the width of theregistered claw shape is displayed, a Z-direction chucking allowancedisplay section in which the chucking allowance in the Z direction ofthe registered claw shape is displayed, and an X-direction chuckingallowance display section in which the chucking allowance in the Xdirection of the registered claw shape is displayed. That is, in thelist display section 54 a, the shape data of the selected claw model isdisplayed for each claw number.

The fixture setting window 54 further includes a claw type displaysection 54 b in which whether the claw is an outer claw or an inner clawis identified and displayed, a holding-diameter display section 54 c inwhich the holding diameter is displayed, a selected claw-number displaysection 54 d in which the selected claw number is displayed, aclaw-number display section 54 e in which the number of claws of theselected claw pattern is displayed, and a fixture display section 54 fin which the selected chuck model, the selected claw model, and theselected workpiece model are displayed in cross section orthree-dimensionally displayed.

When the operator selects desired data from the registered data (clawmodel) of the claw displayed in the list display section 54 a (stepS164), the jig-setting processing unit 12 displays the selected clawnumber in the selected claw-number display section 54 d, displays thenumber of claws in the claw-number display section 54 e, and calculatesa holding position coordinates and a holding diameter of the clawaccording to the procedure shown in FIG. 30.

That is, as shown in FIG. 31, the jig-setting processing unit 12 shiftsa claw model TM so that the selected claw model TM abuts against the endface of the workpiece model WM determined in the workpiece-shape settingprocessing (step S170), and calculates the holding position coordinates,that is, the holding diameter for the claw model TM to hold theworkpiece model WM, based on the shape data of the claw model, theholding position pattern of the claw model (whether holding a corner orholding a flat surface), and the shape data of the workpiece model(outer diameter, inner diameter, length, length of end face) (stepS171). At the time of shift, in the case of the outer claw, the clawmodel TM is shifted so as to abut against the outer diameter of the endface of the workpiece model WM, and in the case of the inner claw, theclaw model TM is shifted so as to abut against the inner diameter of theend face of the workpiece model WM.

In this manner, when it is determined at which position at the end ofthe workpiece model the claw model is held, that is, when calculation ofthe holding position (holding diameter) of the claw is finished, thejig-setting processing unit 12 displays the calculated holding diametervalue in the holding-diameter display section 54 c, and displays thechuck model, the claw model, and the workpiece model in the fixturedisplay section 54 f, in a state with the claw model holding theworkpiece model (step S165).

Thus, the workpiece model is arranged in the first jig model (in thiscase, a first chuck and claw). When the shape data, the number of claws,and the holding diameter of the selected claw model are to be changed,the operator presses the EDIT CLAW button 52 f, or the CHANGE HOLDINGDIAMETER/NUMBER OF CLAWS button 52 c to open the edit dialog, andexecutes the edit processing by the edit dialog.

In this manner, since some jig arrangement patterns are preparedcorresponding to the workpiece-shapes, and the operator selects a jigarrangement pattern to determine the jig arrangement, the jigarrangement becomes easy. Furthermore, since the holding position andthe holding diameter of the claw are calculated on the workpiece model,if the calculation result is transmitted to the NC side, interferencecheck between the tool and the jig (claw) on the NC side can beperformed efficiently.

(4) Registration (Step S103)

The registration processing is started by turning on the ADJUST POSITIONbutton 6 d on the menu selection main screen 8 shown in FIG. 4. Thisregistration processing is mainly executed by the registrationprocessing unit 13 in FIG. 1. In this registration processing, theproduct model is automatically arranged (superposed) in the workpiecemodel held by the first chuck model, and a different portion between thesuperposed workpiece model and the product model is set as a machiningarea, and the machining area is expanded to various types of machiningunits in the subsequent process expansion processing.

First, as shown in (a) of FIG. 33, the product model SM and theworkpiece model WM created in the previous processing are displayed on aregistration screen 55. The workpiece model WM is displayed in a statearranged at a position set at step S102 with respect to a first jig (inthis case, the first chuck and claw) model ZG.

At this time, the workpiece model WM held by the first jig model ZG isarranged at a predetermined position on the registration screen 55, butthe product model SM is arranged at a position corresponding to thecoordinate of the CAD data with respect to the origin of the CAD data.Therefore, when the product model SM and the workpiece model WM areinitially displayed, the positions of the product model SM and theworkpiece model WM normally do not match each other.

In this state, when the operator presses the automatic adjustment button(not shown) arranged in the lower part of the registration screen 55,the registration processing unit 13 executes the registration processingas shown in FIG. 32.

At first, the registration processing unit 13 detects a lathe-turningsurface having the largest diameter among one or more surfaces to bemachined present in the product model SM, and determines a central axisof rotation of the detected lathe-turning surface having the largestdiameter as a Z′ axis (turning axis) (step S180).

The lathe-turning surface is a surface, as shown in FIGS. 34A to 34D,having any one of a surface of a column 310, a surface of a cone 311, asurface of a circular tube (torus) 312, and a surface of a sphere 313,centering on an axis. As shown in FIG. 34E, when a part of thelathe-turning surface is missing, a distance from the central axis ofrotation to the farthest point is designated as a diameter of thelathe-turning surface.

The product model SM is then rotated and parallel-shifted so that the Z′axis determined from the product model SM matches the Z axis (turningaxis) of the workpiece model WM held by the first jig model ZG (stepS181). Furthermore, the product model SM is parallel-shifted so that theend face of the product model SM in the Z′ axis direction matches theprogram origin O (Z=0) of the automatic programming apparatus (stepS182).

The program origin O is preset at a position at the center of theworkpiece model WM in the X-axis direction and at a predetermineddistance from the end face of the workpiece model WM in the Z-axisdirection, away from the first jig model, so that the product model SMis included in the workpiece model WM, when the end face of the productmodel SM in the Z′ direction is arranged so as to match the programorigin O (Z=0). As a result, as shown in (b) of FIG. 33, the productmodel SM is arranged at a machinable position in the workpiece model WM.The position of the program origin O can be changed.

However, at the time of rotation and parallel shift of the product modelSM at step S181, it is not clear which one of the two end faces of theproduct model SM in the Z direction is arranged on the side close to theprogram origin O (on the right side in (b) of FIG. 33). Therefore, whenthe operator checks the direction in the Z direction of the productmodel obtained by automatic arrangement and judges that it is better torotate the product model SM in the Z direction by 180 degrees becausethe chipped allowance is less or the like, the operator presses aZ-reversal button (not shown) arranged on the registration screen 55.The central axis for rotation by 180 degrees is an axis 57 (see FIG. 35)extending in parallel with the X axis from the central position of theproduct model SM in the Z-axis direction. Therefore, as shown in FIG.35, the product model SM is rotated about the axis 57 by 180 degrees,and the direction thereof in the Z direction is reversed (step S183).Even if the product model SM is rotated, the central position of theproduct model does not change.

This registration function includes a manual adjustment function foradjusting the arrangement of the product model SM by the operator. Inthis manual adjustment function, the direction of the product model SMcan be selected, and the product model SM can be rotated or shifted inthe X-, Y-, and Z-axis directions. The manual adjustment function isused when the operator judges that the chipped amount can be reduced bymanual adjustment.

While the registration screen 55 is displayed, when the operator pressesa shape shift key 56 (not shown) arranged on the lower part of theregistration screen 55, a shape shift menu as shown in FIG. 36 isdisplayed.

The shape shift menu includes parallel shift button in the X-, Y-, andZ-axis directions, a rotation button in the X-, Y-, and Z-axisdirections, and a shape shift finish button. When any button is pressed,a shape shift dialog for performing the shift or rotation of the shapeas shown in FIG. 37 is displayed, and the pressed button isreverse-displayed.

As shown in FIG. 37, the shape shift dialog includes a shape selectioncheck-box 60 for selecting an object of shape shift from product shape(product model), workpiece-shape (workpiece model), first chuck shape(first chuck model), and second chuck shape (second chuck model), astep-amount input section 61, a shift-amount input section 62, and aSHIFT button 63.

In the shape selection check-box 60, the shape (model) with a check isparallel-shifted or rotated. When the operator inputs a shift amount ofthe model in the shift-amount input section 62, and presses the SHIFTbutton 63 or the input key, the parallel shift or rotation of the modelis executed. When the shift amount is specified in the shift-amountinput section 62 to shift the model, the model is shifted by thespecified amount once.

When the operator inputs a step amount (unit shift amount) of the modelin the step-amount input section 61, and presses the SHIFT button 63 orthe input key, the parallel shift or rotation of the model is executed.When the operator inputs the step amount in the step-amount inputsection 61, and presses the cursor shift key “↑” or “↓”, while the focusis on the step-amount input section 61, the shape shift is executed. Inthe shape shift by inputting the step amount, a preview of the shape tobe shifted is displayed, and the displayed preview is shifted. When theoperator presses the cursor shift key “↑”, the shape is parallel-shiftedin the “+” direction or rotated, and when the operator presses thecursor shift key “↓”, the shape is parallel-shifted in the “−” directionor rotated. When the operator presses the SHIFT button 63 or the inputkey, the shift of the preview by inputting the step amount is reflectedon the shape, to complete the shape shift. Thus, when the model isstep-shifted by specifying the step amount in the step-amount inputsection 61, the model is shifted by the specified step amount, everytime the cursor shift key “↑” or “↓” is pressed.

In the above explanation, adjustment of the Z axis between the productmodel and the workpiece model and positioning of the end face of theproduct model in the Z-axis direction at the program origin areperformed by one shape shift button, but the adjustment of the Z axisbetween the product model and the workpiece model can be performed byone button, and positioning of the end face of the product model in theZ-axis direction at the program origin can be performed by anotherbutton.

Since the product model is automatically arranged so as to be overlappedin the workpiece model held by the jig model, the time and labor of theoperator to manually calculate the position of the product model withrespect to the workpiece model can be saved, thereby enabling efficientprogramming operations.

(5) Process Dividing (Step S104)

The process dividing processing is started by turning on the DIVIDEPROCESS button 6 e on the menu selection main screen 8 shown in FIG. 4.The process dividing processing is executed by the process-divisionprocessing unit 14 in FIG. 1. The process dividing processing in thiscase is for dealing with machining by a two-spindle machine tool havingthe main spindle and the sub-spindle, and respectively specifying thedividing position between the first process in which a machining area asa difference between the product model and the workpiece model ismachined by the main spindle, and the second process in which themachining area is machined by the sub-spindle, by the outer diameter andthe inner diameter. In the two-spindle machine tool, the workpiece isheld and machined by the main spindle in the first process, and afterthe workpiece is held by the sub-spindle, the workpiece is machined bythe sub-spindle in the second process.

The process dividing processing will be explained according to FIG. 38.On a process dividing processing screen (not shown), at first, theoperator selects whether the process division is performed manually orautomatically (step S150). When the operator selects a manual mode, theprocess-division processing unit 14 extracts characteristic points atwhich the shape of the product model SM, such as a vertex, a hole, and aridge changes on the outer diameter side and the inner diameter side,respectively (step S191). The process-division processing unit 14displays the extracted respective characteristic points on the outerdiameter side and the inner diameter side on the screen as candidates ofprocess division (step S192).

FIG. 39 is one example of a process dividing screen on which a pluralityof characteristic points is displayed. Characteristic points 320 andcandidate lines 321 for process division corresponding to thecharacteristic points are displayed for the outer diameter side and theinner diameter side. The candidate lines 321 for process divisionextends in a direction perpendicular to the Z axis. When there is nocharacteristic point, a position calculated by adding a predeterminedmargin to the chucking allowance of the claw in the first process isdisplayed on the screen as a candidate for process division, so thatmachining is executed as much as possible in the first process in whichmore stable machining can be performed.

The operator refers to these displayed candidates for process divisionto select and specify desired process dividing spots for the innerdiameter and the outer diameter (step S193). The process-divisionprocessing unit 14 calculates a coordinate position on the product modelSM at the selected and specified process dividing spots (step S194).Thus, the process dividing position is determined (step S156).

FIG. 40 is a schematic for illustrating a ½ section of a model in whichthe process dividing spots are specified. In FIG. 17, a product model SMpositioned with respect to the workpiece model WM is shown, and in thiscase, the shape of the product model SM is assumed to be symmetric withrespect to the Z axis. In this product model SM, it is necessary toperform milling at 6 positions (3 positions on one side), in addition todrilling (a hole in the middle) and lathe-turning (outer diameterportion and inner diameter portion). In this case, it is determined thatthe outer diameter side is divided into the first process and the secondprocess at a process dividing position 65, and the inner diameter sideis divided into the first process and the second process at a processdividing position 66.

A milling position 67 located on the first process side belongs to thefirst process, and a milling position 69 located on the second processside belongs to the second process. The process-division processing unit14 determines the machining content such that at a milling position 68in which the process dividing position 65 is present, the whole portionincluding the one belonging to the first process side is machined in thesecond process. This is because it is more efficient to perform millingafter chipping the whole outer diameter, than performing milling in astate that the outer diameter is chipped to half.

On the other hand, when the automatic determination mode is selected atstep S190, the process-division processing unit 14 executes thefollowing processing. That is, the chucking allowance length La of theclaw in the first process is calculated, and a length (La+α) iscalculated by adding a predetermined margin α to the chucking allowancelength La of the claw (step S195), to determine a position of theworkpiece model WM away from the end face in the Z direction on thechuck side for the length (La+α), as the process dividing position (stepS196). A region on the edge side from the determined dividing positionis designated as a first process region to be machined in the firstprocess, and a region on the base side (chuck side) from the dividingposition is designated as a second process region to be machined in thesecond process. A plurality of different values is preset correspondingto the length in the Z direction of the product model or the workpiecemodel as the margin α, so that the margin α is changed corresponding tothe length in the Z direction of the product model or the workpiecemodel.

Another example of the automatic determination processing for processdivision will be explained with reference to FIGS. 41 and 42.

FIG. 42A is the product model SM positioned on the workpiece model WM.When the operator selects the automatic determination mode for processdivision, the process-division processing unit 14 obtains a workpiecemodel in which the machining areas on the front side and the backside,which are to be removed in the end-face processing from the workpiecemodel WM, are deleted (step S200). FIG. 42B is the concept thereof, inwhich a machining area Q1 on the front side and a machining area Q2 onthe backside are removed from the workpiece model WM. That is, themachining area Q1 on the front side and the machining area Q2 on thebackside correspond to the end-face machining allowance explained withreference to FIG. 9, and these machining areas Q1 and Q2 are removedbased on the end-face machining allowance set by the end-facemachining-allowance dialog 305 shown in FIG. 7.

As shown in FIG. 42C, the process-division processing unit 14 dividesthe lathe-turning area in the workpiece model into a lathe-turning areaon the outer diameter side and a lathe-turning area on the innerdiameter side, based on the shape data of the workpiece model from whichthe end-face machining allowance is removed, and the shape data of theproduct model, to obtain a volume Va of the divided lathe-turning areaon the outer diameter side and a volume Vb of the lathe-turning area onthe inner diameter side (step S201).

As shown in FIG. 42D, the process-division processing unit 14 designatesa position in the Z direction, at which the volume Va of thelathe-turning area on the outer diameter side is divided into two, thatis, a position in the Z direction, at which the volume Va1 of alathe-turning area on the outer diameter side in the first process andthe volume Va2 of a lathe-turning area on the outer diameter side in thesecond process become the same, as the process dividing position 65 onthe outer diameter side. Likewise, the process-division processing unit14 designates a position in the Z direction, at which the volume Vb ofthe lathe-turning area on the inner diameter side is divided into two,that is, a position in the Z direction, at which the volume Vb1 of alathe-turning area on the inner diameter side in the first process andthe volume Vb2 of a lathe-turning area on the inner diameter side in thesecond process become the same, as the process dividing position 66 onthe inner diameter side (step S202).

Thus, since the process is automatically divided into the first processand the second process, the time and labor of the operator to divide theprocess manually can be saved, thereby enabling efficient programmingoperations.

In the case of FIGS. 42A to 42D, the position in the Z direction, atwhich the lathe-turning area on the outer diameter side is divided intotwo is designated as a process dividing position on the outer diameterside, and the position in the Z direction, at which the lathe-turningarea on the inner diameter side is divided into two is designated as aprocess dividing position on the inner diameter side. However, aposition in the Z direction, at which the whole machining area on theouter diameter side including lathe-turning and milling is divided intotwo can be designated as a process dividing position on the outerdiameter side, and a position in the Z direction, at which the wholemachining area on the inner diameter side is divided into two can bedesignated as a process dividing position on the inner diameter side.

Furthermore, a position at which the volume of the whole machining areaincluding the end-face machining area is divided into two can bedesignated as the process dividing position. In this case, the processdividing positions on the inner diameter side and the outer diameterside become the same position.

In the case of FIGS. 42A to 42D, only a lathe-turning area is extractedfrom the whole machining area, to obtain the Z position at which theextracted lathe-turning area is divided into two. Therefore, thelathe-turning area is separated from other machining areas in the wholemachining area beforehand, based on the shape data or the like of themachining area. The details of this separation are described in JapanesePatent Application Laid-Open No. 2003-241809 filed by the presentapplicant.

(3)′ Second Process Jig Setting (Setting of Second Chuck and Claw, StepS105)

The second process jig setting is mainly executed by the jig-settingprocessing unit 12 in FIG. 1. The second process jig setting processingis for setting a jig used in the second process, performed by thesub-spindle in the two-spindle machine tool.

In the second process jig setting processing, the operator turns on theSET FIXTURE button 6 c on the menu selection main screen 8 shown in FIG.4, to open the fixture setting menu 52 shown in FIG. 26, and furtherpresses the SET SECOND SPINDLE CLAW button 52 e so as to display theclaw-pattern selection table 53 shown in FIG. 28 and the fixture settingwindow shown in FIG. 29, to perform the same processing as describedabove, thereby setting the claw arrangement of the second chuck on thesub-spindle side.

However, at the time of fitting the workpiece to the sub-spindle, thefirst process has already been completed, and the holding diameter ofthe claw in the second process is determined by assuming theworkpiece-shape after finishing machining in the first process. That is,as shown in FIG. 43, a workpiece model WM′ after machining in the firstprocess has been completed is created by the shape data of the productmodel SM, and the processing similar to the first process jig settingprocessing explained for step S102 is performed, to calculate theholding diameter of the claw.

(4)′ Registration (Step S106)

The registration processing is mainly executed by the registrationprocessing unit 13 in FIG. 1. The registration processing is forautomatically arranging the product model in the workpiece model held bythe second chuck used in the second process. Since the operation thereofis the same as the registration processing explained for step S103, theexplanation is omitted.

(6) Process Expansion (Step S107)

The process expansion processing is started by turning on the EXPANDUNIT button 6 f on the menu selection main screen 8 shown in FIG. 4. Theprocess expansion processing is mainly executed by the process-expansionprocessing unit 15 in FIG. 1.

The process expansion processing is for breaking down a series ofmachining operation including lathe-turning, point machining, surfacemachining, chamfering and the like, referred to as machining modes, intomachining units in which continuous machining is performed with the samemain spindle and the same tool. The machining operation is formed as acombination of a plurality of machining units. In the process expansionprocessing, the machining operation both in the first process and thesecond process is expanded into a unit of machining units.

It is assumed that the default of the sequence in the automatic processexpansion in the case of combined machining is lathe-turning→surfacemachining→point machining→chamfering, and this sequence can beoptionally set by the operator. A rule for process-expanding only thepoint machining can be set by omitting lathe-turning, surface machining,and chamfering, in order to deal with machining for performing only holedrilling.

The default of the sequence in respective machining in the lathe-turningis end-face machining→lathe-turning drill (central hole)→machining ofouter diameter of a bar→machining of inner diameter of the bar, and thissequence can be al optionally set by the operator. Therefore, even asequence of end-face machining→machining of outer diameter of abar→lathe-turning drill→machining of inner diameter of the bar ispossible, and a sequence of end-face machining→lathe-turningdrill→machining of inner diameter of the bar→machining of outer diameterof the bar is also possible.

The surface machining is process-expanded in order of from the onehaving a shallow machining depth. In the case of cylindrical shape, orcylindrical shape+conic shape, the point machining is expanded todrilling, and in the case of two cylindrical shapes having differentdiameters+conic shape, the point machining is expanded to a washer facedhead. When machining attribute data is added to the CAD data, expansionto tapping, reaming, boring, and perfect circle is possible. The pointmachining is classified into four shape sequences of point, row, square,and lattice according to the array of holes having the same diameter,and the efficiency of point machining is improved by performing drillingin the sequence determined by the classified respective shape sequences.Furthermore, the diameter of the hole is compared with a threshold, todetermine whether to perform point machining or pocket milling based onthe comparison result, and either the point machining or pocket millingis executed according to the determination result. In this case, thethreshold of the diameter can be optionally set.

In point machining, it is automatically determined whether each hole isa through hole that can be machined by one point machining as shown inFIG. 44A, or two holes that can be machined only by two-point-machiningas shown in FIG. 44B, and point machining is expanded according to thedetermination result.

FIG. 45 is one example of process expansion of lathe-turning only forthe inner diameter portion. Reference sign 70 denotes a ½ cross sectionof the product model. In this case, an area 71 is first machined bylathe-turning and drilling, and the inner diameter of an area 72 ismachined by lathe-turning. In the second process, the inner diameter ofan area 73 is machined by lathe-turning. These respective areas 71, 72,and 73 are respectively one machining unit.

As shown in (a) of FIG. 46, when a portion 75 to be point-machined ispresent in the lower part of a lathe-turning area 74 in an area betweenthe claws of the first chuck, as shown in (b) of FIG. 46, the hole shapeof the portion 75 to be point-machined is extended to the surface of theworkpiece model, and the point machining of the portion 75 to bepoint-machined, with the hole shape being extended, is performed in thefirst process, in which more stable machining can be normally performedthan in the second process. The lathe-turning workpiece with respect tothe lathe-turning area 74 is performed in the second process.

The details of the process expansion processing are described inJapanese Patent Application Laid-Open No. 2003-241809 filed by thepresent applicant.

(7) Tool Selection (Step S108)

The process expansion processing described below is mainly executed bythe tool-selection processing unit 16 in FIG. 1. FIG. 47 is an automaticexpansion procedure of the tool sequence.

At first, a finishing allowance expansion for determining a finishingallowance corresponding to a finish mark in the CAD data is performed(step S210). Tool type expansion for determining how many tools are tobe used for machining the respective process-expanded portions to bemachined is then performed (step S211). Tool determination processingfor selecting an optimum tool for the respective portions to be machinedfrom the tool database is performed next (step S212). Lastly, since thetools are determined, a cutting condition corresponding to the tool isdetermined (step S213).

(8) Program Expansion (Step S109)

The program expansion processing is started by turning on the CREATEPROGRAM button 6 h on the menu selection main screen 8 shown in FIG. 4.The program expansion processing is mainly executed by theprogram-expansion processing unit 19 in FIG. 1.

In the program expansion processing, NC creation programs for the firstand the second processes made of a predetermined language are created,based on the combination of the process-expanded machining units, thedetermined tool information, and the cutting condition. The NC creationprograms are converted to NC programs as numerical programs on the NCunit 200 side or the second NC controller 201 side in FIG. 1.

(9) Non-Expandable Shape Editing (Step S110)

The non-expandable shape editing processing is mainly executed by thenon-expandable-shape-editing processing unit 17 in FIG. 1. Thenon-expandable shape editing processing is for performing editingworkpiece for converting a non-expandable shape that cannot beautomatically expanded to the machining unit in the previous processexpansion processing into some machining unit.

The non-expandable shape includes a curved face, a shape requiringmachining by a special tool, a shape that is not included in themachining units in the NC creation program created by the automaticprogramming apparatus, a tapered portion of a tapered pocket and theupper part thereof, an R portion and a fillet portion of a bottom R anda pocket with bottom fillet, and the upper part thereof.

The non-expandable shapes that cannot be automatically expanded to themachining unit are displayed, as shown in (a) of FIG. 48, asnon-expandable shapes 81 and 82 in a machining shape tree 80, whichhierarchically displays the machining units on a tree.

In the machining shape tree 80, editing operation such as a change ofthe machining unit name, a sequence change of machining units, andswitching of valid/invalid of the machining unit can be performed. InFIG. 48, “outer diameter of bar”, “pocket mill”, and “non-expandableshape” are added as the machining unit names, and the figure added onthe left of the machining unit name shows the machining order of themachining units. When the order of the machining units is changed,interference due to the order change is checked.

The non-expandable shape can be expanded, as shown in (b) of FIG. 48, tothe NC creation program that can be created by the automatic programmingapparatus, by changing the machining unit name, for example, from“non-expandable” to “pocket mill”, and specifying the shape sequence(how to specify the shape expressing the profile) and the tool.

(10) Program Editing (Step S111)

The program edit processing is started by turning on the EDIT UNITbutton 6 g on the menu selection main screen 8 shown in FIG. 4. Theprogram edit processing is mainly executed by the program-editingprocessing unit 18 in FIG. 1. In this program edit processing, editprocessing of the created NC creation program is performed. The createdNC creation program includes machining units and machining programscorresponding to respective machining units.

As shown in FIG. 49, a program editing screen 84 has the machining shapetree 80 and a program tree 85, a three-dimensional display section 86,an editor section 87, and a menu display section 91.

The machining shape tree 80 hierarchically displays machining unitnames, as also shown in FIG. 48, in a tree format. The program tree 85hierarchically displays a machining program in a unit of machining unitin a tree format. In the three-dimensional display section 86, any oneof the product model and the workpiece or both (a synthetic modelobtained by overlapping the workpiece model on the product model) isthree-dimensionally displayed by a wire frame or the like.

In the editor section 87, when the machining shape tree 80 is selectedfor display, machining unit data (data including the shape sequenceindicating the machining shape and machining contents) corresponding tothe machining unit name selected in the machining shape tree 80 isdisplayed, and when the program tree 85 is selected for display, amachining program corresponding to the program name (in the case of FIG.54, a program name the same as the machining unit name is provided)selected on the program tree 85 is displayed. In the editor section 87,the cursor is positioned at the top of the machining unit datacorresponding to the machining unit or the machining program, selectedin the machining shape tree 80 or the program tree 85.

First, highlighting display processing of the machining unit in thethree-dimensional display section 86 will be explained with reference toFIG. 50. The processing in FIG. 50 is the highlighting displayprocessing by the program-editing processing unit 18.

It is assumed that one machining unit name is selected in the machiningshape tree 80 to display the machining unit data such as the shapesequence in the editor section 87, or one machining program name isselected on the program tree to display the machining program body inthe editor section 87. The program-editing processing unit 18 detectsthis (step S220), and highlight-displays a machining unit 89corresponding to the position of the cursor 88 in the editor section 87in the three-dimensional display section 86 (step S221).

Thus, since the machining unit corresponding to the cursor position ishighlight-displayed in the three-dimensional display section 86, it canbe determined clearly to which machining unit the cursor positioncorresponds, thereby making the editing operation efficient, andreducing editing errors.

Insertion processing of the shape sequence constituting the machiningunit data will be explained with reference to FIG. 52. In the shapesequence insertion processing, the shape selected in thethree-dimensional display section 86 can be inserted in the cursorposition in the editor section 87 as the shape sequence. This functionis a convenient function at the time of editing a non-expandable shape.This function is executed in the following manner.

First, the operator selects a machining unit name into which theoperator wants to insert a shape sequence (in this case, it is assumedto be a non-expandable unit) on the program tree 85. The operatorselects the whole shape of the non-expandable unit on the program tree85 or the three-dimensional display section 86. FIG. 51A is a state inwhich the whole non-expandable unit is displayed.

The operator then selects a shape element for which the operator wantsto obtain a coordinate value (for example, one plane) in thethree-dimensional display section 86 by a mouse or the like. A selectedplane 90 is highlight-displayed in the three-dimensional display section86, as shown in FIG. 51B.

In this state, after having shifted the cursor position in the editorsection 87 to a desired position, when the operator presses a “INSERTSHAPE SEQUENCE” button (not shown) in the menu display section 91 on theprogram editing screen 84 (step S230), as shown in FIG. 53, a shapesequence corresponding to the selected plane 90 is inserted in thecursor position in the editor section 87 (step S231).

Thus, since the shape selected in the three-dimensional display section86 can be inserted in the cursor position in the editor section 87 as ashape sequence, editing operation of the non-expandable shape and thelike can be performed efficiently. In the above explanation, the shapesequence in the machining unit data is inserted in the cursor position,but machining unit data corresponding to the machining unit selected inthe three-dimensional display section 86 can be inserted in the cursorposition.

The insertion processing of the machining program name and the machiningprogram corresponding to the machining unit name selected in themachining shape tree 80 will be explained with reference to FIG. 55.This insertion function can be used when a program for a machining unitis destroyed due to an erroneous operation, and can perform programconversion in a unit of machining unit. This function is executed in thefollowing manner.

The operator selects a machining unit name to be inserted in themachining shape tree 80 (see FIG. 54). The operator then selects themachining program name next to the position to be inserted (in the caseof FIG. 54, the machining unit name and the machining program name matcheach other) is selected on the program tree 85. At this time, the cursorin the editor section 87 is positioned at the head of the machiningprogram corresponding to the program name selected on the program tree85.

In this state, when the operator presses a “INSERT UNIT” button (notshown) in the menu display section 91 on the program editing screen 84(step S240), the machining program name corresponding to the machiningunit name selected in the machining shape tree 80 is inserted in frontof the machining program name selected on the program tree 85 in a unitof machining unit, and the machining program corresponding to themachining unit name selected in the machining shape tree 80 is insertedin front of the cursor position in the editor section 87 in a unit ofmachining unit.

Thus, since the machining program name and the machining programcorresponding to the machining unit name can be easily inserted in aunit of machining unit, at a desired position on the program tree 85 andthe editor section 87, the editing operation can be efficientlyperformed when a machining program for a machining unit is destroyed orthe like. A program name next to the position to be inserted is firstselected on the program tree 85, and then a machining unit name to beinserted next can be selected in the machining shape tree 80.

A second embodiment of the present invention will be explained withreference to FIGS. 56 and 57. The automatic programming apparatus in thefirst embodiment is an automatic programming apparatus applied to thetwo-spindle machine tool having two spindles, that is, the main spindleand the sub-spindle installed so as to face the main spindle. However,the automatic programming apparatus in the second embodiment is anautomatic programming apparatus applicable to the two-spindle machinetool having the two spindles of the main spindle and the sub-spindle,and a one-spindle machine tool having only the main spindle.

In the case of the two-spindle machine tool, machining in the firstprocess and machining in the second process can be performedcontinuously by the main spindle side and the sub-spindle side.Therefore, in the automatic programming apparatus, one program forcontinuously executing the machining in the first process and themachining in the second process is created. In contrast, in the case ofthe one-spindle machine tool, after finishing machining in the firstprocess, the workpiece is reversed and held again on the main spindleside to perform machining in the second process, in order to perform themachining in the first process and the machining in the second processonly by the main spindle. Therefore, in the automatic programmingapparatus, two machining programs, that is, a machining program in thefirst process and a machining program in the second process, arecreated.

In the case of a machine having only the main spindle, without thesub-spindle, after process 1 (corresponding to the first process) isfinished, the workpiece model is reversed and the reversed workpiecemodel is held again by the chuck model of the main spindle, to executeprocess 2 (corresponding to the second process) for performing themachining for the remaining area. In other words, in the one-spindlemachine tool, machining is performed by holding one end of the workpiecemodel by the first spindle machine in process 1, and machining isperformed by holding the other end of the workpiece model by the firstspindle machine in process 2.

As shown in FIG. 56, the automatic programming apparatus in the secondembodiment includes a one-spindle-program creating unit 330, which is anautomatic programming apparatus for creating a machining program for aone-spindle machine, a two-spindle-program creating unit 331, which isan automatic programming apparatus for creating a machining program fora two-spindle machine, and a determining unit 340 that determines whichis the control object, of the two-spindle machine or the one-spindlemachine, and activates either the one-spindle-program creating unit 330or the two-spindle-program creating unit 331 according to thedetermination result.

The operation of the automatic programming apparatus in the secondembodiment will be explained with reference to the flowchart in FIG. 57.The automatic programming apparatus has the determining unit 340 thatdetermines whether the machine tool to be controlled has a sub-spindle,and the determining unit 340 determines, at the time of startup of theprogram, whether the machine tool to be controlled is a machine with asub-spindle (second spindle) (step S400). That is, when the automaticprogramming apparatus is started for the first time, the operatorregisters whether the machine tool to be controlled has a sub-spindle,in an interactive mode using an appropriate dialog, and the registeredidentification information indicating the presence of the sub-spindle isstored, so that the determining unit 340 refers to the storedidentification information at the time of startup of the program, todetermine whether the machine tool to be controlled has the sub-spindle.The automatic programming apparatus also has a function capable ofchanging the registered identification information.

Thus, the automatic programming apparatus has first software(two-spindle-program creating unit 331) for creating an NC creationprogram for creating an NC program for machining a product from a work,for the two-spindle machine tool having two spindles of the main spindleand the sub-spindle as a control object, and second software(one-spindle-program creating unit 330) for creating an NC creationprogram for creating an NC program for machining a product from a work,for the one-spindle machine tool having the main spindle as a controlobject. At the time of startup of the program, the determining unit 340determines which machine tool is to be controlled, of the one-spindlemachine tool and the two-spindle machine tool, so as to start either thefirst software or the second software. The first software and the secondsoftware include many common parts.

When the determining unit 340 determines that a machine with thesub-spindle is to be controlled, as in the first embodiment, processingat steps S100 to S109 is executed by the first software (see FIG. 2).According to such processing, since the first process and the secondprocess are program-expanded simultaneously at steps S107 and S108, thecreated NC creation program is one continuous program including thefirst process program, the workpiece delivery program, and the secondprocess program, and capable of automatically operating the wholeprocess. In this case, the program for the second process is created,succeeding the information in the first process. Therefore, in thesecond process, the product shape input processing at step S100 and theworkpiece-shape setting processing at step S101 can be omitted, therebyenabling efficient program creation.

On the other hand, when the determining unit 340 determines that aone-spindle machine tool without having a sub-spindle is to becontrolled, the following processing is performed by the secondsoftware. At first, the product shape input processing similar to thatof step S100 is performed (step S401), the workpiece-shape settingprocessing similar to that of step S101 is performed (step S402), thenare subsequently performed first process (process 1) jig settingprocessing similar to that of step S102 (step S403), registrationprocessing similar to that of step S103 (step S404), and processdividing processing similar to that of step S104 (step S405).

When the one-spindle machine tool is to be controlled, process expansionand tool selection for process 1 only are executed (step S406). Programexpansion for only process 1 is then executed (step S407). The workpiecemodel is then reversed by 180 degrees, and held again by the chuck modelof the main spindle (step S408).

Second process (process 2) jig setting processing similar to that ofstep S105 (step S409), and registration processing similar to that ofstep S106 (step S410) are performed.

Process expansion and tool selection for only process 2 are executed(step S411), and program expansion for only process 2 is executed (stepS412). The NC creation program including the process 1 program and theprocess 2 program is created in this manner.

According to the second embodiment, it is determined whether the machinetool to be controlled has a sub-spindle, and either the automaticprogramming apparatus for one-spindle machine or the automaticprogramming apparatus for two-spindle machine is operated according tothe determination. As a result, an automatic programming apparatusapplicable to the two-spindle machine tool having the main spindle andthe sub-spindle, and the one-spindle machine tool having only the mainspindle can be provided.

INDUSTRIAL APPLICABILITY

The automatic programming method and device according to the presentinvention is useful for software for creating an NC creation program forcreating an NC program of an NC unit, for a two-spindle machine toolhaving the main spindle and the sub-spindle, or a one-spindle machinetool having only the main spindle as a control object.

1-9. (canceled)
 10. An automatic programming method of selectingworkpiece data from a workpiece database in which a material, a shape,and a dimension of a workpiece are registered, creating a workpiecemodel for lathe turning based on the selected workpiece data, andcreating a program for controlling a numerical control device based on aproduct model for lathe turning and the created workpiece model, theautomatic programming method comprising: workpiece selecting includingselecting workpiece data involving a product shape and having a smallestdiameter for lathe turning around a turning axis from the workpiecedatabase, by comparing dimension data of the workpiece model withdimension data of the product model in a state in which the productmodel is arranged on the turning axis and the workpiece model isarranged so that a center axis of each workpiece matches a center of theturning axis; and selecting, when there is a plurality of workpiece datainvolving the product shape and having the smallest diameter for latheturning around the turning axis, workpiece data having a length equal toor longer than the product shape and a shortest length; and creating theworkpiece model for lathe turning based on the selected workpiece data.11. The automatic programming method according to claim 10, wherein ashape of the workpiece is a round bar, and the workpiece selectingfurther includes obtaining a longest distance between the turning axisand a fringe area of the product model; and selecting a round-bar workhaving a radius equal to or longer than the longest distance and asmallest diameter.
 12. The automatic programming method according toclaim 10, wherein a shape of the workpiece is a polygonal bar, and theworkpiece selecting further includes obtaining respective distancesbetween line segments parallel to respective fringes of the polygonalbar and tangent to the product model and the turning axis; obtaining amaximum value from among the obtained distances; and selecting apolygonal work model having an opposite side distance equal to or largerthan twice of the obtained maximum value and a shortest opposite sidedistance.
 13. The automatic programming method according to claim 10,wherein the workpiece selecting further includes displaying theworkpiece data registered in the workpiece database in a list; andhighlighting minimum workpiece data from among the workpiece datadisplayed in the list.
 14. The automatic programming method according toclaim 10, wherein the workpiece selecting further includes displayingworkpiece data involving a product shape is in a list from the workpiecedatabase in an increasing order of cutting amount; and highlightingminimum workpiece data from among the workpiece data displayed in thelist.
 15. A computer-readable recording medium that stores a computerprogram for selecting workpiece data from a workpiece database in whicha material, a shape, and a dimension of a workpiece are registered,creating a workpiece model for lathe turning based on the selectedworkpiece data, and creating a program for controlling a numericalcontrol device based on a product model for lathe turning and thecreated workpiece model, wherein the computer program causes a computerto execute: workpiece selecting including selecting workpiece datainvolving a product shape and having a smallest diameter for latheturning around a turning axis from the workpiece database, by comparingdimension data of the workpiece model with dimension data of the productmodel in a state in which the product model is arranged on the turningaxis and the workpiece model is arranged so that a center axis of eachworkpiece matches a center of the turning axis; and selecting, whenthere is a plurality of workpiece data involving the product shape andhaving the smallest diameter for lathe turning around the turning axis,workpiece data having a length equal to or longer than the product shapeand a shortest length; and creating the workpiece model for latheturning based on the selected workpiece data
 16. An automaticprogramming apparatus for selecting workpiece data from a workpiecedatabase in which a material, a shape, and a dimension of a workpieceare registered, creating a workpiece model for lathe turning based onthe selected workpiece data, and creating a program for controlling anumerical control device based on a product model for lathe turning andthe created workpiece model, the automatic programming apparatuscomprising: a workpiece selecting unit that selects workpiece datainvolving a product shape and having a smallest diameter for latheturning around a turning axis from the workpiece database, by comparingdimension data of the workpiece model with dimension data of the productmodel in a state in which the product model is arranged on the turningaxis and the workpiece model is arranged so that a center axis of eachworkpiece matches a center of the turning axis, and when there is aplurality of workpiece data involving the product shape and having thesmallest diameter for lathe turning around the turning axis, selectsworkpiece data having a length equal to or longer than the product shapeand a shortest length; and a workpiece-model creating unit that createsthe workpiece model for lathe turning based on the selected workpiecedata.
 17. The automatic programming apparatus according to claim 16,wherein a shape of the workpiece is a round bar, and the workpieceselecting unit obtains a longest distance between the turning axis and afringe area of the product model, and selects a round-bar work having aradius equal to or longer than the longest distance and a smallestdiameter.
 18. The automatic programming apparatus according to claim 16,wherein a shape of the workpiece is a polygonal bar, and the workpieceselecting unit obtains respective distances between line segmentsparallel to respective fringes of the polygonal bar and tangent to theproduct model and the turning axis, obtains a maximum value from amongthe obtained distances, and selects a polygonal work model having anopposite side distance equal to or larger than twice of the obtainedmaximum value and a shortest opposite side distance.
 19. The automaticprogramming apparatus according to claim 16, wherein the workpieceselecting unit displays the workpiece data registered in the workpiecedatabase in a list, and highlights minimum workpiece data from among theworkpiece data displayed in the list.
 20. The automatic programmingapparatus according to claim 16, wherein the workpiece selecting unitdisplays workpiece data involving a product shape is in a list from theworkpiece database in an increasing order of cutting amount, andhighlights minimum workpiece data from among the workpiece datadisplayed in the list.